<?php

/**
 * DetallePaciente form base class.
 *
 * @package    form
 * @subpackage detalle_paciente
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 8508 2008-04-17 17:39:15Z fabien $
 */
class BaseDetallePacienteForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                   => new sfWidgetFormInputHidden(),
      'paciente_id'          => new sfWidgetFormDoctrineChoice(array('model' => 'Paciente', 'add_empty' => false)),
      'tipo_glucosa_id'      => new sfWidgetFormDoctrineChoice(array('model' => 'TipoGlucosa', 'add_empty' => false)),
      'clasificacion_imc_id' => new sfWidgetFormDoctrineChoice(array('model' => 'ClasificacionImc', 'add_empty' => false)),
      'peso'                 => new sfWidgetFormInput(),
      'estatura'             => new sfWidgetFormInput(),
      'glucosa'              => new sfWidgetFormInput(),
      'created_at'           => new sfWidgetFormDateTime(),
      'updated_at'           => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'                   => new sfValidatorDoctrineChoice(array('model' => 'DetallePaciente', 'column' => 'id', 'required' => false)),
      'paciente_id'          => new sfValidatorDoctrineChoice(array('model' => 'Paciente')),
      'tipo_glucosa_id'      => new sfValidatorDoctrineChoice(array('model' => 'TipoGlucosa')),
      'clasificacion_imc_id' => new sfValidatorDoctrineChoice(array('model' => 'ClasificacionImc')),
      'peso'                 => new sfValidatorNumber(),
      'estatura'             => new sfValidatorNumber(),
      'glucosa'              => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'created_at'           => new sfValidatorDateTime(array('required' => false)),
      'updated_at'           => new sfValidatorDateTime(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('detalle_paciente[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'DetallePaciente';
  }

}
